package seventeen;

/**
 * @author zzb
 * @since 2021-01-14
 */

//ConcreteMediator
public class ConcreteMediator extends Mediator {

  private ColleagueA ca;
  private ColleagueB cb;

  public ConcreteMediator() {
    this.ca = new ColleagueA();
    this.cb = new ColleagueB();
  }

  @Override
  public void notice(String content) {
    if (content.equals("boss")) { //老板来了, 通知员工 A
      ca.action();
    }
    if (content.equals("client")) {
      //客户来了, 通知知前台 B
      cb.action();
    }
  }
}
